import {request} from "../utils/http"

//请求购物车的数据
export const reqShopCartData = () => {
  return request.get(`/api/cart/cartList`)
}
//添加或更新购物车事件
export const addOrUpdateCartReq = ({skuId, skuNum}) => {
  return request.post(`/api/cart/addToCart/${ skuId }/${ skuNum }`)
}
//修改单个商品选中状态
export const reqChangeOenIsChecked = ({skuId, isChecked}) =>{
  return request.get(`/api/cart/checkCart/${skuId}/${isChecked}`)
}
//修改全选状态
export const reqChangeAllIsChecked = (isChecked,skuIdList) =>{
  return request.post(`/api/cart/batchCheckCart/${isChecked}`,skuIdList)
}
//删除单个商品的请求
export const reqDeleteOneGoods = (skuId) =>{
  return request.delete(`/api/cart/deleteCart/${skuId}`)
}
//批量删除
// export const reqDeleteIsChecked